/******************************************************************************
 * Title:     Younker Web Application Framework
 * Copyright: Copyright (c) 2004
 * Company:   YounkerSoft
 * Author:    Xiao Jian
 * Version:   2.0
 *****************************************************************************/
package com.younker.waf.core.sec;

import org.infohazard.maverick.flow.ControllerContext;

import com.younker.waf.maverick.DispatchCtl;

public class UserAction extends DispatchCtl {

	@Override
	protected Object makeFormBean(ControllerContext cctx) {

		return new RuntimeUser();
	}

	public String changePassword(Object formBean, ControllerContext cctx) {
		RuntimeUser u = (RuntimeUser) formBean;
		int ret_code = AuthorizationBean.getInsance().changePassword(
				u.getLoginName(), u.getPassword(), u.getNewPsw());
		cctx.getRequest().setAttribute(RET_CODE, ret_code);
		return SUCCESS;
	}
}